package com.bjpowernode.aspect.exercise;
import com.bjpowernode.aspect.exercise.beans.*;
//代理类的目的就是改变目标方法，我们把这种行为加做【方法增强enhance】
public class MyApp {
    public static void main(String[] args) {
        //目标类实例化
        //这里注意目标类，不能自己执行doing
        Stu stu = new Stu();
        Teacher teacher = new Teacher();
        Worker worker = new Worker();
        Bus bus = new Bus();
        //代理类，代理stu执行doing
        Proxy proxy = new Proxy(stu);
        proxy.doing();
        proxy = new Proxy(teacher);
        proxy.doing();
        proxy = new Proxy(worker);
        proxy.doing();
        //代理类，代理bus执行doing
        proxy = new Proxy(bus);
        proxy.doing();
    }
}
